home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / share / doc / fakeroot / README.saving < prev   
Text File  |  2009-03-01  |  3KB  |  71 lines

  1. The fakeroot environment can be saved for later use if you use the -s
  2. option to fakeroot. This will not work perfectly, however.
  3.  
  4. Internally, faked keeps track of all files which have had operations
  5. done on them that the user would not normally be able to do, in order to
  6. fake the effect later.
  7.  
  8. For example, if you create a device node, faked will actually create an
  9. empty file, but remember that it was a device node (along with the
  10. relevant details) so that if you subsequently do an "ls -l", you'll see
  11. it as a device node.
  12.  
  13. The save option simply saves this list, so later fakeroot invocations
  14. can restore them.
  15.  
  16. However, you can manipulate the files saved outside of the fakeroot
  17. environment (for example, you could delete the zero-length file that was
  18. the placeholder for the device node) and fakeroot will not know about it
  19. when it loads up the list again. This will cause the list to leak.
  20.  
  21. The list cannot easily be verified, either, because it keys things by
  22. inode number, and there is no mechanism to look up anything from one of
  23. those alone. Such verification _could_ be done, but would in theory
  24. require a search through the _entire_ filesystem, every time. This isn't
  25. really acceptable for regular operation, and I don't need such a feature
  26. so I haven't written it. The file format is fairly straightforward and
  27. obvious, however, so if anybody else wants to...  :-)
  28.  
  29. So, this feature should only be used if you limit everything you do
  30. inside the fakeroot environment to the fakeroot environment. This is
  31. still useful - for example (assuming you have the appropriate key):
  32.  
  33. $ fakeroot -s backup.environ
  34. # mkdir backup
  35. # cd backup
  36. # export RSYNC_RSH=ssh
  37. # rsync -a root@important.example.com:/ .
  38. [...]
  39. # exit
  40. $
  41.  
  42. Now, "fakeroot -i backup.environ" will get you exactly what you had
  43. backed up, user and group information, device nodes and everything. Of
  44. course, that information is still faked, but you should be able to
  45. happily rsync it back. This way you only need normal user privileges on
  46. the backup machine. This is great to back up multiple machines without a
  47. compromise affecting the backup machine and thereby compromising all the
  48. other machines you back up as well.
  49.  
  50. Note that further rsync updates should be done with:
  51.  
  52. $ fakeroot -i backup.environ -s backup.environ
  53. # cd backup
  54. # export RSYNC_RSH=ssh
  55. # rsync -a root@important.example.com:/ .
  56. [...]
  57. # exit
  58. $
  59.  
  60. so that further changes are still saved.
  61.  
  62. In this scenario, the shortcoming will not affect anything, as the only
  63. modification of files which required root (and consequently were faked)
  64. is done inside the environment, and can therefore be tracked and saved.
  65.  
  66. Have fun!
  67.  
  68. Robie Basak <robie@principle.co.uk>
  69. Northern Principle Limited
  70. 25/3/2003.
  71.